package org.apache.flink.runtime.resourceconsumer;

import java.util.UUID;

import org.apache.flink.runtime.providermanager.ProviderManagerLocation;
import org.apache.flink.runtime.resourceprovider.ResourceProviderGateway;

/**
 * @类名: ResourceProviderRegistration
 * @说明: 资源提供者注册
 *
 * @author   leehom
 * @Date	 2024年2月19日 上午10:33:44
 * 修改记录：
 *
 * @see 	 
 */
final class ResourceProviderRegistration {
    private final ProviderManagerLocation taskManagerLocation;
    private final ResourceProviderGateway taskExecutorGateway;
    private final UUID sessionId;

    private ResourceProviderRegistration(
            ProviderManagerLocation taskManagerLocation,
            ResourceProviderGateway taskExecutorGateway,
            UUID sessionId) {
        this.taskManagerLocation = taskManagerLocation;
        this.taskExecutorGateway = taskExecutorGateway;
        this.sessionId = sessionId;
    }

    ProviderManagerLocation getTaskManagerLocation() {
        return taskManagerLocation;
    }

    ResourceProviderGateway getTaskExecutorGateway() {
        return taskExecutorGateway;
    }

    UUID getSessionId() {
        return sessionId;
    }

    static ResourceProviderRegistration create(
            ProviderManagerLocation taskManagerLocation,
            ResourceProviderGateway taskExecutorGateway,
            UUID sessionId) {
        return new ResourceProviderRegistration(taskManagerLocation, taskExecutorGateway, sessionId);
    }
}
